﻿using System;
using System.Collections.Generic;

namespace bruke.Code
{
    public static class Class1
    {
        public static void AddIF<T>(this IList<T> list,T item,Func<bool> func)
        {
            if (list==null)
            {
                throw new ArgumentNullException("list");
            }
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (func())
            {
                list.Add(item);
            }
        }
    }
}
